<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>instanceof</title>
</head>
<body>
  <h1>instanceof</h1>
  <!-- 
    instanceof是如何判断的？
      * 表达式：A instanceof B
      * 如果B函数的显示原型所指向的对象在A对象的原型链上则返回true,否则返回false
        A走隐示原型链，B走显示原型链
        沿着A的原型链往上查找如果在A的原型链中找到B的原型则返回true
   -->
   <script>
     /* 
      案例
     */
    console.log(Object instanceof Function)//true
    console.log(Object instanceof Object)//true
    console.log(Function instanceof Function)//true
    console.log(Function instanceof Object)//true
    function Foo(){}
    console.log(Object instanceof Foo)//false
    console.log(Foo instanceof Object)//false
   </script>
</body>
</html>